package com.yonyou.cyxdms.sysAuth.service.dto.notification;

import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;

/**
 * <p>
 * 通知通告信息表DTO
 * </p>
 *
 * @author chengliang
 * @since 2019-09-11
 */

public class NotificationDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 通知ID
     */
    private Long notificationId;


    /**
     * 通知主题
     */
    private String notificationTitle;


    /**
     * 通告类型
     */
    private Integer notificationType;


    /**
     * 通知正文
     */
    private String notificationContent;


    /**
     * 紧急程度
     */
    private Integer urgency;


    /**
     * 通知通告有效开始时间
     */
//    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
//    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private String startTime;

    /**
     * 通知通告有效结束时间
     */
//    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
//    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private String endTime;


    /**
     * 是否全网发布
     */
    private Integer isAll;


    /**
     * 状态（已保存，已发布）
     */
    private Integer status;

    /**
     * 阅读状态（）
     */
    private Integer readStatus;


    /**
     * 发布人
     */
    private String publishPerson;


    /**
     * 发布部门ID
     */
    private Long publishOrgId;


    /**
     * 发布时间
     */
//    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
//    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private String publishDate;


    /**
     * 公司代码
     */
    private String companyCode;


    /**
     * 所有者代码
     */
    private String ownerCode;


    /**
     * 所有者的父组织代码（用于二网使用）
     */
    private String ownerParCode;


    /**
     * 组织ID
     */
    private Integer orgId;


    /**
     * 是否删除
     */
    private Integer isDeleted;


    public NotificationDTO() {
        super();
    }

    public Integer getReadStatus() {
        return readStatus;
    }

    public void setReadStatus(Integer readStatus) {
        this.readStatus = readStatus;
    }

    public Long getNotificationId() {
        return notificationId;
    }

    public void setNotificationId(Long notificationId) {
        this.notificationId = notificationId;
    }

    public String getNotificationTitle() {
        return notificationTitle;
    }

    public void setNotificationTitle(String notificationTitle) {
        this.notificationTitle = notificationTitle;
    }

    public Integer getNotificationType() {
        return notificationType;
    }

    public void setNotificationType(Integer notificationType) {
        this.notificationType = notificationType;
    }

    public String getNotificationContent() {
        return notificationContent;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public void setNotificationContent(String notificationContent) {
        this.notificationContent = notificationContent;
    }

    public Integer getUrgency() {
        return urgency;
    }

    public void setUrgency(Integer urgency) {
        this.urgency = urgency;
    }


    public Integer getIsAll() {
        return isAll;
    }

    public void setIsAll(Integer isAll) {
        this.isAll = isAll;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getPublishPerson() {
        return publishPerson;
    }

    public void setPublishPerson(String publishPerson) {
        this.publishPerson = publishPerson;
    }

    public Long getPublishOrgId() {
        return publishOrgId;
    }

    public void setPublishOrgId(Long publishOrgId) {
        this.publishOrgId = publishOrgId;
    }


    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public String getOwnerParCode() {
        return ownerParCode;
    }

    public void setOwnerParCode(String ownerParCode) {
        this.ownerParCode = ownerParCode;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(String publishDate) {
        this.publishDate = publishDate;
    }

    public Integer getOrgId() {
        return orgId;
    }

    public void setOrgId(Integer orgId) {
        this.orgId = orgId;
    }


    @Override
    public String toString() {
        return "NotificationDTO{" +
                "notificationId=" + notificationId +
                ", notificationTitle=" + notificationTitle +
                ", notificationType=" + notificationType +
                ", notificationContent=" + notificationContent +
                ", urgency=" + urgency +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", isAll=" + isAll +
                ", status=" + status +
                ", publishPerson=" + publishPerson +
                ", publishOrgId=" + publishOrgId +
                ", publishDate=" + publishDate +
                ", companyCode=" + companyCode +
                ", ownerCode=" + ownerCode +
                ", ownerParCode=" + ownerParCode +
                ", orgId=" + orgId +
                ", isDeleted=" + isDeleted +
                "}";
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author chengliang
     * @since 2019-09-11
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author chengliang
     * @since 2019-09-11
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "notificationId");
    }

}
